﻿if exists (select * from dbo.sysobjects where id = object_id(N'dbo.ChangeTransaction') and OBJECTPROPERTY(id, N'IsTable') = 1)
drop table dbo.ChangeTransaction

GO

CREATE TABLE dbo.ChangeTransaction
(
	ID bigint not null CONSTRAINT PkChangeTransaction_ID PRIMARY KEY CLUSTERED,
	SourceTableId int not null,
	TrackingMask varchar(258) not null,
	UserName varchar(50) not null,
	HostName varchar(50) not null,
	AppName varchar(100) not null,
	ChangeDate datetime not null,
	Spid int not null,
	CmdType varchar(10) not null
	CONSTRAINT CkCmdType CHECK ( CmdType in ('INSERT','UPDATE','DELETE'))
)

GO

exec sp_addextendedproperty 'CdcDbType', 'CdcStorage', NULL, NULL, NULL, NULL